import Vue from 'vue';
import Router from 'vue-router';

Vue.use( Router );

const pcPath = 'view/pc/public/pages';
const mobilePath = 'view/mobile/public/pages';
const LoginPc = () => import( `@/${pcPath}/Login.vue` );
const LoginMobile = () => import( `@/${mobilePath}/Login.vue` );

// todo: 路由配置信息
const routes = [
  {
    path: '',
    name: 'pub-login',
    redirect: '/login'
  },
  {
    path: '/login',
    name: 'pub-login-pc',
    component: LoginPc
  },
  {
    path: '/login-mobile',
    name: 'pub-login-mobile',
    component: LoginMobile
  }
];

const router = new Router( {
  routes,
  scrollBehavior() {
    return {
      x: 0,
      y: 0
    };
  },
  strict: process.env.NODE_ENV !== 'production'
} );

export default router;
